<template>
  <div :class="{ 'header-fixed': isfixed }">
    <div class="header-top">
      <div class="top-block">
        <div class="top-block-left">
          <div>
            <span class="icon iconfont">&#xe652;</span>
          </div>
          <div class="font-size">分类</div>
        </div>
        <div class="top-block-center" @click="goHotSearch">
          <div>
            <span class="icon iconfont">&#xe6b9;</span>
          </div>
          <div>
            <!-- <input type="text" placeholder="金秋佳节 爆仓五折" /> -->
            <span>55寸电视低至199元</span>
          </div>
        </div>
        <div class="top-block-right">
          <div>
            <span class="icon iconfont">&#xe603;</span>
          </div>
          <div class="font-size" @click="goLogin">登录</div>
        </div>
      </div>
      <!-- <div class="search-blcok">22</div> -->
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {}
  },
  name: 'headerTop',
  props: {
    isfixed: {
      type: Boolean,
      default: false,
    },
  },
  methods: {
    goHotSearch() {
      this.$router.push('/hotSearch')
    },
    goLogin() {
      this.$router.push('/login')
    },
  },
}
</script>
<style lang="less" scoped>
@import '../../style/mixin.less';
.header-fixed {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
}
.header-top {
  height: 2.2rem;
  background-color: #ffdb47;
  .top-block {
    height: 100%;
    display: flex;
    .top-block-left {
      width: 2.34666rem;
      color: #fff;
      text-align: center;
      overflow: hidden;
      > div:nth-child(1) {
        margin-top: 5px;
        .icon {
          font-size: 0.9rem;
        }
      }

      .font-size {
        font-size: 0.5rem;
        transform: scale(0.7);
      }
    }
    .top-block-right {
      width: 2.34666rem;
      color: #fff;
      text-align: center;
      overflow: hidden;
      > div:nth-child(1) {
        margin-top: 5px;
        .icon {
          font-size: 0.9rem;
        }
      }

      .font-size {
        font-size: 0.5rem;
        transform: scale(0.7);
      }
    }
    .top-block-center {
      flex: 1;
      display: flex;
      background-color: #fff;
      overflow: hidden;
      border-radius: 0.8533333rem;
      height: 1.365333rem;
      .positionCenter();
      > div {
        height: 100%;
        &:nth-child(1) {
          width: 1.6rem;
          text-align: center;
          color: #ddd;
          > span {
            font-size: 0.85rem;
            position: relative;
            top: 0.15rem;
          }
        }
        &:nth-child(2) {
          flex: 1;
          > span {
            font-size: 0.5973333rem;
            position: relative;
            left: -5px;
            top: 2px;
          }
        }
      }
    }
  }
  .search-blcok {
    height: 1.9626666rem;
  }
}
</style>
